package by.dvrudenko.avtobaza.webapp.utils.renderer;

import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.model.ResourceModel;

import by.dvrudenko.avtobaza.datamodel.enums.OrderStatus;

public class OrderStatusChoiseRenderer implements IChoiceRenderer<OrderStatus> {

	public static OrderStatusChoiseRenderer INSTANCE = new OrderStatusChoiseRenderer();

	private OrderStatusChoiseRenderer() {
		super();
	}

	@Override
	public Object getDisplayValue(OrderStatus orderStatus) {
		return new ResourceModel(orderStatus.name()).getObject();
	}

	@Override
	public String getIdValue(OrderStatus orderStatus, int index) {
		return orderStatus.toString();
	}

}
